class WaterTypeResultModel {
  late int code;
  late String message;
  late Content content;

  WaterTypeResultModel(
      {required this.code, required this.message, required this.content});

  WaterTypeResultModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    message = json['message'];
    content = (json['content'] != null
        ? new Content.fromJson(json['content'])
        : null)!;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['message'] = this.message;
    if (this.content != null) {
      data['content'] = this.content.toJson();
    }
    return data;
  }
}

class Content {
  late int total;
  late int page;
  late int perPage;
  late List<Data> data;

  Content(
      {required this.total,
      required this.page,
      required this.perPage,
      required this.data});

  Content.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    page = json['page'];
    perPage = json['per_page'];
    if (json['data'] != null) {
      data = <Data>[];
      json['data'].forEach((v) {
        data.add(new Data.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total'] = this.total;
    data['page'] = this.page;
    data['per_page'] = this.perPage;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Data {
  late int id;
  late String name; //用水类型名称
  late double tax; //水资源税
  late double seweragePrices; //污水处理费
  late String isOpen; //是否执行阶梯水价
  late double basePrice; //基础水价
  late double totalPrice; //综合水价
  late double ladder1Start; //阶梯1/年/起始用水量
  late double ladder1End; //阶梯1/年/结束均用水量
  late double ladder1Price; //阶梯1水价价格
  late double ladder1PriceTotal; //阶梯1综合水价
  late double ladder2Start; //阶梯2/年/起始用水量
  late double ladder2End; //阶梯2/年/结束均用水量
  late double ladder2Price; //阶梯2水价价格
  late double ladder2PriceTotal; //阶梯2综合水价
  late double ladder3Start; //阶梯3/年/起始用水量
  late double ladder3End; //阶梯3/年/结束均用水量
  late double ladder3Price; //阶梯3水价价格
  late double ladder3PriceTotal; //阶梯3综合水价
  late String remark; //描述
  late String createDate; //创建时间
  late String updateDate; //更新时间
  late String status;
  late int adId; //行政区划id
  late String adName; //行政区划名称
  ///信用等级
  late String creditLevel;
  Data(
      {required this.id,
      required this.name,
      required this.tax,
      required this.seweragePrices,
      required this.isOpen,
      required this.basePrice,
      required this.totalPrice,
      required this.ladder1Start,
      required this.ladder1End,
      required this.ladder1Price,
      required this.ladder1PriceTotal,
      required this.ladder2Start,
      required this.ladder2End,
      required this.ladder2Price,
      required this.ladder2PriceTotal,
      required this.ladder3Start,
      required this.ladder3End,
      required this.ladder3Price,
      required this.ladder3PriceTotal,
      required this.remark,
      required this.createDate,
      required this.updateDate,
      required this.status,
      required this.adId,
      required this.adName,
      required this.creditLevel});

  Data.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    tax = json['tax'];
    seweragePrices = json['sewerage_prices'];
    isOpen = json['is_open'];
    basePrice = json['base_price'];
    totalPrice = json['total_price'];
    ladder1Start = json['ladder_1_start'];
    ladder1End = json['ladder_1_end'];
    ladder1Price = json['ladder_1_price'];
    ladder1PriceTotal = json['ladder_1_price_total'];
    ladder2Start = json['ladder_2_start'];
    ladder2End = json['ladder_2_end'];
    ladder2Price = json['ladder_2_price'];
    ladder2PriceTotal = json['ladder_2_price_total'];
    ladder3Start = json['ladder_3_start'];
    ladder3End = json['ladder_3_end'];
    ladder3Price = json['ladder_3_price'];
    ladder3PriceTotal = json['ladder_3_price_total'];
    remark = json['remark'];
    createDate = json['create_date'];
    updateDate = json['update_date'];
    status = json['status'];
    adId = json['ad_id'];
    adName = json['ad_name'];
    creditLevel = json['credit_level'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['tax'] = this.tax;
    data['sewerage_prices'] = this.seweragePrices;
    data['is_open'] = this.isOpen;
    data['base_price'] = this.basePrice;
    data['total_price'] = this.totalPrice;
    data['ladder_1_start'] = this.ladder1Start;
    data['ladder_1_end'] = this.ladder1End;
    data['ladder_1_price'] = this.ladder1Price;
    data['ladder_1_price_total'] = this.ladder1PriceTotal;
    data['ladder_2_start'] = this.ladder2Start;
    data['ladder_2_end'] = this.ladder2End;
    data['ladder_2_price'] = this.ladder2Price;
    data['ladder_2_price_total'] = this.ladder2PriceTotal;
    data['ladder_3_start'] = this.ladder3Start;
    data['ladder_3_end'] = this.ladder3End;
    data['ladder_3_price'] = this.ladder3Price;
    data['ladder_3_price_total'] = this.ladder3PriceTotal;
    data['remark'] = this.remark;
    data['create_date'] = this.createDate;
    data['update_date'] = this.updateDate;
    data['status'] = this.status;
    data['ad_id'] = this.adId;
    data['ad_name'] = this.adName;
    return data;
  }
}
